{% extends "panel.html" %}
{% block content %}
    {% if user.is_authenticated %}
        <h3 class="title">{{user.username}}'s Party:</h3>
        <div id="friends">
            {% if user.userprofile.friends.all|length > 0 %}
                {% for friend in user.userprofile.friends.all %}
                    <div class="friend">
                        <a href="#{{friend.pk}}" class="outlet" outlet="profile" methods="click">{{friend.user.username}}</a>
                        <a href="#{{friend.pk}}" class="outlet" outlet="friend"  methods="click" action="remove">x</a>
                    </div>
                {% endfor %}
            {% else %}
            <div>You are a lone wolf.</div>
            {% endif %}
        </div>
        <h3 class="title">Add Party Member:</h3>
        <form action="#" method="post" id="friend_add_form" class="outlet" outlet="friend" methods="submit">
            <input type="text" class="text" name="username" />
            <input type="submit" value="Add" />
            <div class="token"></div>
        </form>
    {% else %}
        Your party does not recognize you.
    {% endif %}
{% endblock %}
